

package com.zmks.jkgj.xuexiao.controller;




import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;


import com.zmks.jkgj.core.controller.ABaseController;
import com.zmks.jkgj.core.resp.Resp;
import com.zmks.jkgj.xuexiao.resp.WebResp;
import com.zmks.jkgj.xuexiao.service.ICrctObjParentService;

import com.zmks.jkgj.xuexiao.vo.CrctObjParentVO;

/**
 * 
 * @author jiangyaning
 *  家长信息
 */
@Controller
public class CrctObjParentController extends ABaseController {
	
	@Autowired
	
	private ICrctObjParentService crctObjParentService;	

	 //查询
	@RequestMapping("/get_CrctObjParent_list")
	@ResponseBody
	public Resp get_CrctObjParent_list( Integer pageIndex,
			Integer pageSize,HttpServletRequest request) {
		WebResp 	webResp = new WebResp();
	   CrctObjParentVO CrctObjParentVO=new  CrctObjParentVO();
		webResp.setData(crctObjParentService.getList(CrctObjParentVO));
			webResp.setTotalCount(crctObjParentService.getCount(CrctObjParentVO));
		return webResp;
	}
	 //增加
	@RequestMapping("/save_CrctObjParent")
	@ResponseBody
	public Resp save_CrctObjParent(
		
			String account_oid,
			String name,
			String sex,
			String birthday,
			String card_id,
			String mobile,
			String email,
			String work,
			String relation,
			HttpServletRequest request) {
		WebResp 	webResp = new WebResp();
	   CrctObjParentVO crctObjParentVO=new  CrctObjParentVO();
	   crctObjParentVO.setAccount_oid(Long.parseLong(account_oid));
	   crctObjParentVO.setName(name);
	   crctObjParentVO.setSex(sex);
	   crctObjParentVO.setBirthday(new Date());
	   crctObjParentVO.setCard_id(card_id);
	   crctObjParentVO.setMobile(mobile);
	   crctObjParentVO.setEmail(email);
	   crctObjParentVO.setWork(work);
	   crctObjParentVO.setRelation(relation);
	   crctObjParentVO.setCreate_date(new Date());
	   crctObjParentService.save(crctObjParentVO);
		return webResp;
	}
	 //删除
	@RequestMapping("/remove_CrctObjParent")
	@ResponseBody
	public Resp remove_CrctObjParent( Long id,
		Integer pageSize,HttpServletRequest request) {
		WebResp 	webResp = new WebResp();
		CrctObjParentVO CrctObjParentVO=new  CrctObjParentVO();
		crctObjParentService.remove(id);
		return webResp;
	}
	
	
	
	

}
